package com.bobochang.warehouse.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bobochang.warehouse.entity.LocationConstruction;
import com.bobochang.warehouse.page.Page;
import com.bobochang.warehouse.service.LocationConstructionService;
import com.bobochang.warehouse.mapper.LocationConstructionMapper;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author bobochang
 * @description 针对表【location_construction(施工位置表)】的数据库操作Service实现
 * @createDate 2024-06-25 10:17:40
 */
@Service
public class LocationConstructionServiceImpl extends ServiceImpl<LocationConstructionMapper, LocationConstruction>
        implements LocationConstructionService {

    @Resource
    private LocationConstructionMapper locationMapper;

    @Override
    public Page queryLocationPage(Page page, LocationConstruction locationConstruction) {
        // 查询施工位置总行数
        int locationCount = locationMapper.selectLocationCount(locationConstruction);
        // 分页查询施工位置
        List<LocationConstruction> locationList = locationMapper.selectLocationPage(page, locationConstruction);
        // 结果封装到Page对象
        page.setTotalNum(locationCount);
        page.setResultList(locationList);
        return page;
    }
}




